/* pages/index/index.wxss */
.scroll-y {
  height: calc(100vh - 150rpx);
}
/* 浮动发布按钮 */
.fab {
  position: fixed;
  right: 30rpx;
  bottom: 200rpx; /* 避开底部tabbar */
  width: 100rpx;
  height: 100rpx;
  border-radius: 50%;
  background: #20b26b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.18);
  z-index: 999;
}

.fab-icon {
  color: #fff;
  font-size: 56rpx;
  line-height: 1;
}

/* 加载更多状态 */
.loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40rpx 0;
  color: #999;
}

.loading-more .loading-spinner {
  width: 40rpx;
  height: 40rpx;
  border: 4rpx solid #f3f3f3;
  border-top: 4rpx solid #20b26b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 20rpx;
}

.loading-more .loading-text {
  font-size: 28rpx;
  color: #999;
}

/* 没有更多了 */
.no-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40rpx 0;
}

.no-more-text {
  font-size: 28rpx;
  color: #999;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.index-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
}

/* 顶部搜索栏 */
.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20rpx 30rpx;
  background-color: #ffffff;
  border-bottom: 1rpx solid #f0f0f0;
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  border-radius: 25rpx;
  padding: 0 20rpx;
  height: 70rpx;
  margin-right: 20rpx;
}

.search-icon {
  font-size: 32rpx;
  color: #999999;
  margin-right: 15rpx;
}

.search-input {
  flex: 1;
  font-size: 28rpx;
  color: #333333;
}

.search-placeholder {
  color: #999999;
  font-size: 28rpx;
}

.clear-icon {
  font-size: 24rpx;
  color: #999999;
  margin-left: 10rpx;
  padding: 8rpx;
  border-radius: 50%;
  background-color: #f0f0f0;
}

.notification-icon {
  font-size: 36rpx;
  color: #333333;
}

/* 搜索结果样式 */
.search-results {
  position: absolute;
  top: 110rpx;
  left: 0;
  right: 0;
  background: #ffffff;
  z-index: 1000;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  border-radius: 0 0 16rpx 16rpx;
}

.search-results-header {
  padding: 20rpx 30rpx;
  border-bottom: 1rpx solid #f0f0f0;
}

.search-results-title {
  font-size: 28rpx;
  color: #666666;
  font-weight: 500;
}

.search-results-list {
  max-height: 600rpx;
  padding: 0 30rpx 20rpx;
}

.no-results {
  text-align: center;
  padding: 80rpx 0;
}

.no-results-text {
  font-size: 28rpx;
  color: #999999;
}

.search-item {
  display: flex;
  align-items: center;
  padding: 20rpx 0;
  border-bottom: 1rpx solid #f8f8f8;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item-image {
  width: 80rpx;
  height: 80rpx;
  border-radius: 8rpx;
  margin-right: 20rpx;
  flex-shrink: 0;
}

.search-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.search-item-title {
  font-size: 28rpx;
  color: #333333;
  font-weight: 500;
  margin-bottom: 8rpx;
  line-height: 1.4;
}

.search-item-desc {
  font-size: 24rpx;
  color: #666666;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* 导航栏 */
.nav-container {
  background-color: #ffffff;
  border-bottom: 1rpx solid #f0f0f0;
}

.nav-scroll {
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  padding: 0 60rpx;
  min-width: max-content;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20rpx 70rpx;
  font-size: 30rpx;
  color: #666666;
  position: relative;
  white-space: nowrap;
  margin-right: 20rpx;
}

.nav-item.active {
  color: #333333;
  font-weight: bold;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40rpx;
  height: 4rpx;
  background-color: #ff6b6b;
  border-radius: 2rpx;
}

.nav-item:active {
  transform: scale(0.95);
}

/* 分类样式 */

.category-two-pane {
  display: flex;
  height: calc(100vh - 260rpx); // 扣掉顶部区域，确保右侧可滚
}

.category-left {
  width: 120rpx;
  background: #f7f8fa;
  border-right: 1rpx solid #eee;
}

.left-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24rpx 20rpx;
  font-size: 28rpx;
  color: #666;
  position: relative;
}

.left-item.active {
  background: #ffffff;
  color: #333;
}

.left-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6rpx;
  background: #ff6b6b;
}

.left-icon {
  margin-right: 12rpx;
}

.category-right {
  flex: 1;
  background: #ffffff;
  padding: 20rpx 20rpx 40rpx;
  display: flex;
  flex-direction: column;
}

.category-right-scroll {
  height: calc(100vh - 200rpx);
  flex: 1;
}

.empty-tip {
  color: #999;
  text-align: center;
  padding: 80rpx 0;
}

.right-grid {
  display: flex;
  flex-direction: column;
  gap: 16rpx;
  padding: 0 0 180rpx 0;
}

.right-card {
  background: #ffffff;
  border-radius: 12rpx;
  padding: 16rpx;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
  border: 1rpx solid #f0f0f0;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  margin-bottom: 16rpx;
}

.right-card:active {
  transform: scale(0.98);
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}

.right-image-box {
  width: 140rpx;
  height: 140rpx;
  border-radius: 8rpx;
  overflow: hidden;
  margin-right: 20rpx;
  flex-shrink: 0;
}

.right-image {
  width: 100%;
  height: 100%;
}

.right-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.right-title {
  font-size: 28rpx;
  color: #333;
  font-weight: 500;
  line-height: 1.4;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30rpx;
  padding: 0 30rpx;
}

.categoty-show {

}



.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20rpx 10rpx;
  background-color: #f8f9fa;
  border-radius: 16rpx;
  transition: all 0.3s ease;
}

.category-item:active {
  transform: scale(0.95);
  background-color: #e9ecef;
}

.category-icon {
  font-size: 48rpx;
  margin-bottom: 10rpx;
}

.category-name {
  font-size: 24rpx;
  color: #333333;
  text-align: center;
}

/* 徽章样式 */
.hot-badge, .share-badge, .medicine-badge {
  position: absolute;
  top: 10rpx;
  right: 10rpx;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 20rpx;
  padding: 4rpx 8rpx;
  font-size: 20rpx;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}

.hot-badge {
  background-color: rgba(255, 107, 107, 0.9);
  color: #ffffff;
}

.share-badge {
  background-color: rgba(52, 152, 219, 0.9);
  color: #ffffff;
}

.medicine-badge {
  background-color: rgba(46, 204, 113, 0.9);
  color: #ffffff;
}

/* 统计信息 */
.recipe-stats {
  display: flex;
  align-items: center;
  margin-top: 10rpx;
  gap: 15rpx;
}

.stat-item {
  font-size: 20rpx;
  color: #999999;
}

/* 标签样式 */
.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8rpx;
  margin-top: 10rpx;
}

.tag {
  background-color: #e8f5e8;
  color: #2d5a3d;
  font-size: 20rpx;
  padding: 4rpx 8rpx;
  border-radius: 12rpx;
}

/* 活动横幅 */
.banner-section {
  padding: 20rpx 30rpx;
}

.activity-banner {
  background: linear-gradient(135deg, #a8e6cf 0%, #88d8a3 100%);
  border-radius: 16rpx;
  padding: 30rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-left, .banner-right {
  display: flex;
  align-items: center;
}

.banner-title, .banner-subtitle {
  font-size: 28rpx;
  color: #2d5a3d;
  font-weight: 500;
}

.banner-star {
  font-size: 24rpx;
  margin-left: 10rpx;
}

/* 内容区域 */
.content-section {
  flex: 1;
  min-height: 0; /* 允许子级 scroll-view 在 flex 布局中滚动 */
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20rpx;
  padding-bottom: 180rpx;
  margin-top: 20rpx
}

.recipe-card {
  background-color: #ffffff;
  border-radius: 16rpx;
  overflow: hidden;
  box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.recipe-card:active {
  transform: scale(0.98);
}

.card-image {
  width: 100%;
  height: 240rpx;
  position: relative;
  overflow: hidden;
}

.recipe-image {
  width: 100%;
  height: 100%;
}

.card-content {
  padding: 20rpx;
}

.recipe-title {
  font-size: 26rpx;
  color: #333333;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: 15rpx;
}

.recipe-desc {
  font-size: 22rpx;
  color: #666666;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.recipe-author {
  display: flex;
  align-items: center;
  margin-top: 10rpx;
}

.author-avatar {
  width: 40rpx;
  height: 40rpx;
  border-radius: 50%;
  margin-right: 10rpx;
}

.author-name {
  font-size: 22rpx;
  color: #999999;
}

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-top: 1rpx solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10rpx 0 20rpx 0;
  z-index: 1000;
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10rpx;
  position: relative;
  margin-right: 0;
}

.bottom-nav .nav-item.active .nav-text {
  color: #ff6b6b;
}

.nav-icon {
  font-size: 36rpx;
  margin-bottom: 5rpx;
}

.nav-text {
  font-size: 20rpx;
  color: #666666;
}

.add-btn {
  background-color: #ff6b6b;
  border-radius: 50%;
  width: 80rpx;
  height: 80rpx;
  margin: -20rpx 0;
}

.add-icon {
  font-size: 40rpx;
  color: #ffffff;
  font-weight: bold;
}

/* 加载状态样式 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80rpx 0;
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 60rpx;
  height: 60rpx;
  border: 4rpx solid #f3f3f3;
  border-top: 4rpx solid #ff6b6b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20rpx;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 28rpx;
  color: #999999;
}

/* 响应式设计 */
@media (max-width: 750rpx) {
  .content-grid {
    gap: 15rpx;
  }
  
  .recipe-card {
    border-radius: 12rpx;
  }
  
  .card-image {
    height: 180rpx;
  }
  
  .recipe-title {
    font-size: 24rpx;
  }
  
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20rpx;
  }
}
